package nowCoder;

import java.util.Scanner;

public class HJ32 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String x = in.nextLine();
        int n = x.length()-1;
        char[] xx = x.toCharArray();
        while (n == 1){
            int p = 1;
            for (int i = 0; n+i < x.length(); i++) {
                if (xx[i] != xx[n+i]){
                    break;
                }
                boolean b = true;
                for (int j = i+1; j+n < n + i; j++) {
                    if (xx[j] != xx[n+j]){
                        b = false;
                        break;
                    }
                }
                if (b) {
                    System.out.println(n);
                    return;
                }
            }
            n--;
        }
    }
}
